import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/recommend'
  },
  {
    path: '/recommend',
    name: 'Recommend',
    component: () => import(/* webpackChunkName: "Recommend" */ '../views/recommend/Recommend'),
    children: [{
      path: ':id',
      component: () => import(/* webpackChunkName: "Album" */ '../views/recommend/Album')
    }]
  }, {
    path: '/singer',
    name: 'Singer',
    component: () => import(/* webpackChunkName: "Singer" */ '../views/singer/Singer'),
    children: [{
      path: ':id',
      component: () => import(/* webpackChunkName: "SingerDetail" */ '../views/singer/SingerDetail')
    }]
  }, {
    path: '/topList',
    name: 'TopList',
    component: () => import(/* webpackChunkName: "Singer" */ '../views/topList/TopList'),
    children: [{
      path: ':id',
      component: () => import(/* webpackChunkName: "TopDetail" */ '../views/topList/TopDetail')
    }]
  }, {
    path: '/search',
    name: 'search',
    component: () => import(/* webpackChunkName: "search" */ '../views/search/Search'),
    children: [{
      path: ':id',
      component: () => import(/* webpackChunkName: "SingerDetail" */ '../views/singer/SingerDetail')
    }]
  }, {
    path: '/user',
    components: {
      user: () => import(/* webpackChunkName: "UserCenter" */ '../views/userCenter/UserCenter')
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
